package com.zqp.security.core.validator.code;
import java.io.Serializable;
/**
 * 
* @author zqp
* @version2017年12月21日 
* @description
 */
/***
 * 
 */
import java.time.LocalDateTime;
/**
 * 短信验证码
* @author zqp
* @version2017年12月23日 
* @description
 */
public class ValidateCode implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 4584214028764680164L;
	private String code;//随机数
	private LocalDateTime expireTime;//过期时间

	public ValidateCode( String code, LocalDateTime expireTime) {
		super();
		this.code = code;
		this.expireTime = expireTime;
	}
	/**
	 * 多少秒之内过期
	 * @param image
	 * @param code
	 * @param expireInt
	 */
	public ValidateCode( String code, int expireInt) {
		super();
		this.code = code;
		this.expireTime = LocalDateTime.now().plusSeconds(expireInt);
	}


	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public LocalDateTime getExpireTime() {
		return expireTime;
	}

	public void setExpireTime(LocalDateTime expireTime) {
		this.expireTime = expireTime;
	}
	
	public boolean isExpried() {
		return LocalDateTime.now().isAfter(expireTime);
	}

}
